/*
 * @Author: sjr
 * @Date: 2021-02-01 07:01:41
 * @LastEditTime: 2021-02-01 07:09:33
 * @LastEditors: sjr
 * @Description: 描述
 * @FilePath: \leetcode\70.爬楼梯.js
 */
/*
 * @lc app=leetcode.cn id=70 lang=javascript
 *
 * [70] 爬楼梯
 */

// @lc code=start
/**
 * @param {number} n
 * @return {number}
 */
var climbStairs = function(n) {
  let a = 1
  let b = 1
  for(let i = 0; i < n; i++) {
    [a,b] = [b,a+b]
  }
  return a
};
// @lc code=end

